#include "enrollaccount.h"
#include "ui_enrollaccount.h"
#include<Windows.h>
enrollaccount::enrollaccount(QWidget *parent)
    : QWidget(parent)
    , ui(new Ui::enrollaccount)
{
    ui->setupUi(this);

}

enrollaccount::~enrollaccount()
{
    delete ui;
}

void enrollaccount::on_pushButton_enroll_clicked()
{
    bool accountnull=ui->lineEdit_account->text().isEmpty();
    bool secretnull=ui->lineEdit_secret->text().isEmpty();
    bool namenull=ui->lineEdit_name->text().isEmpty();
    if(!accountnull&&!secretnull&&!namenull)
    {
        emit setAccount(ui->lineEdit_account->text());
        emit setSecret(ui->lineEdit_secret->text());
        emit setName(ui->lineEdit_name->text());
        emit infoready();
    }
    //设置一个延时等待服务端检测注册是否成功
    Sleep(350);
    if(enrollsuccess==true)
        close();
}

